package com.maozzi.service.acl.openapi;

import brave.Tracer;
import com.maozzi.api.acl.AclService;
import com.maozzi.api.acl.model.AclUserDTO;
import com.maozzi.common.model.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * acl rest  open api
 *
 * @author maozi
 */
@RestController
@RequestMapping("openapi/acl")
@Slf4j
public class AclOpenApi {
    @Resource
    private AclService aclService;
    @Resource
    private Tracer tracer;

    @GetMapping("getAclUser")
    public ResultVO<AclUserDTO> getAclUser(Long userId) {
        log.info("getAclUser--------start,traceId={}", tracer.currentSpan().context().traceIdString());
        AclUserDTO aclUser = aclService.getAclUser(userId);
        return ResultVO.success(aclUser);
    }
}
